/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.admin.vo;

import io.swagger.annotations.ApiModelProperty;
import org.springblade.common.cache.DictCache;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.admin.entity.MaintainPlanContent;
import lombok.Data;
import lombok.EqualsAndHashCode;
import io.swagger.annotations.ApiModel;
import org.springblade.modules.admin.vo.plan.MaintainTemplateInfoVO;

import java.util.Date;
import java.util.List;

/**
 * 维保任务表视图实体类
 *
 * @author ysq
 * @since 2022-03-09
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "MaintainPlanContentVO对象", description = "维保任务表")
public class MaintainPlanContentVO extends MaintainPlanContent {
	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "状态名称")
	private String statusName;

	@ApiModelProperty(value = "小区名称")
	private String buildingName;

	@ApiModelProperty(value = "小区类型")
	private String buildingType;

	@ApiModelProperty(value = "小区类型")
	private String buildingTypeName;

	@ApiModelProperty(value = "电梯地址")
	private String elevatorAddress;

	@ApiModelProperty(value = "小区id")
	private Long buildingId;

	@ApiModelProperty(value = "0:初始化 1:提前2:延后，3：延期4：特殊")
	private Integer defertType;

	@ApiModelProperty(value = "1:非年审，2:年审")
	private Integer auditType;

	@ApiModelProperty(value = "物业电梯id")
	private Long estateElevatorId;

	@ApiModelProperty(value = "电梯设备id")
	private String deviceId;

	@ApiModelProperty(value = "工单执行人信息")
	private List<SignUserVO> planUsers;

	@ApiModelProperty(value = "工单创建时间")
	private Date planCreateTime;

	@ApiModelProperty(value = "工单结束时间")
	private Date planEndTime;

	@ApiModelProperty(value = "模板信息集合")
	private List<MaintainTemplateInfoVO> templates;

	public void setBuildingType(String buildingType) {
		this.buildingType = buildingType;
		if(Func.isNotEmpty(buildingType)){
			this.buildingTypeName = DictCache.getValue("building_type",buildingType);
		}
	}
}
